<?php
/**
 * The main template file.
 *
 */
 
  $tlset = get_option( 'tlset' );
  get_header();  
  
   
/********** Code Index
 *
 * -01- FETCH SLIDESHOW
 * -02- FETCH TAGLINE
 * -03- TOP CAROUSEL
 * -04- MAIN PART		
 */

?>
<div class="slidein">
	<div class="slideout">
	<div class="row">
		<div class="twelve columns" style="position: relative;">
			<?php echo cro_fetch_slider(); ?>
		</div>
	</div>
</div>
</div>
</div>


<div class="mainbody">
	<div class="mainin">
<?php if ( is_active_sidebar( 'tlicartop' ) ) { 

	echo '<div class="cro_carousel"><div class="cro_carinner">';
	echo '<div class="row">';
	dynamic_sidebar( 'tlicartop' );
	echo '</div></div></div>';

} ?>		





<!--
 * -05- START THE MAINBODY
-->
<div class="mbod">


<!--
 * -03- MAIN PART
-->		

<div class="row">		
	<div class="eight columns cro_maincolumns">


			<?php if ($tlset['blog_frontpage'] == 2) { ?>


			<?php 
				while ( have_posts() ) : the_post();
				get_template_part( 'public/tparts/content', get_post_format() ); 
				endwhile; 
			?>
			<?php cro_paging(); ?>	


			<?php } else { ?>


			<?php if (isset($tlset['index-pagelink']) && $tlset['index-pagelink'] >= 1){
							
				echo tl_fetch_welcomenote($tlset['index-pagelink']);				
			} ?>
			
		
			<?php } ?>

		<div class="row">

		<div class="six columns">
				<?php if ( is_active_sidebar( 'trifronttop' ) ) { 
					echo '<ul class="mainwidget">';
					dynamic_sidebar( 'trifronttop' );
					echo '</ul>';
				} ?>		
			
		</div> <!-- .c-4 -->	

		<div class="six columns">
			<?php if ( is_active_sidebar( 'tcifronttop' ) ) { 
				echo '<ul class="mainwidget">';
				dynamic_sidebar( 'tcifronttop' );
				echo '</ul>';
			} ?>			
		</div> <!-- .c-4 -->	

	</div>
								
						
	</div> <!-- .c-8 -->

		
		
		<div class="four columns">
			<?php if ( is_active_sidebar( 'tlifronttop' ) ) { 
				echo '<ul class="mainwidget widgdark">';
				dynamic_sidebar( 'tlifronttop' );
				echo '</ul>';
			} ?>		
			
		</div> <!-- .c-4 -->

		<div class="clearfix"></div>
	</div>

</div>


<?php if(cro_woocommerce_activated() && $tlset['cro_commfront'] == 1) { ?>
<div class="row">
	<div class="twelve column">
		<div class="wooshow">
			<div class="cro_accent wooptitle">
				<?php echo $tlset['cro_storelabel']; ?>
			</div>
			<div class="cro_accent woopstorelink">
				<a href="<?php echo get_permalink (get_option('woocommerce_shop_page_id')); ?>"><?php echo $tlset['cro_cartlink']; ?></a>
			</div>
			<div class="clearfix"></div>
		<?php 

				echo '<ul class="woofront">';

				$args = array(
					'post_type' => 'product',
					'showposts' => 3
				);
				$loop = new WP_Query( $args );

				if ( $loop->have_posts() ) {
					while ( $loop->have_posts() ) : $loop->the_post();
					woocommerce_get_template_part( 'content', 'product' );
					endwhile;
				} else {
					echo __( 'No products found','localize' );
				}
				echo '<li class="clearfix"></li>';
				echo '</ul>';
		?>	
		</div>
	</div>
</div>
<?php } ?>
			
<?php get_footer(); ?>
